<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>预览</title>
<link href="../style/pagination.css" rel="stylesheet" type="text/css" />
<script src="../js/jquery-1.4.2.min.js"></script>
</head>
<body>
<script type="text/javascript" src="../js/jquery.pagination.js"></script>
<script type="text/javascript">
	$(function(){
		$.ajax({
			url : "preview-content.do",
			type : "post",
			async : false,
			data:{
				'id':'${article.id}'
			},
			dataType : 'json',
			success : function(data) {		
				$("#Pagination").pagination(parseInt('${article_content_count}'), {
					num_edge_entries: 1, //两侧显示的首尾分页的条目数
					num_display_entries: 8, //连续分页主体部分显示的分页条目数
					items_per_page: 1, //每页显示的条目数
					callback: function pageselectCallback(page_index, jq){
						$('#articlelist').html(data[page_index]);
						return false;
					},			
					prev_text: "前一页",
					next_text: "后一页"
				});
			},
			error : function() {
				alert('error');
			}
		});
		
		$('.btn_return').bind('click',function(){
			location.href="article-list.do";
		});
	});
</script>

<div id="container">
	<div id="wrapper" style="font-size: 14px;>
	  	<div class="title_left"><label for="title" style="padding-left:8px;">&nbsp;&nbsp;&nbsp;标题 ：</label>
			${article.title }"<span class="error"></span>
		</div>
		<div class="left">
			<label for="release_date">发布日期 ：</label><fmt:formatDate value="${article.releaseDate }" type="date" timeStyle="full"/></br>	
			<label for="source">内容来源 ：</label>${article.source }	
		</div>		
	</div>
	<div id="articlelist"></div>
	<div class="paging">
		<div id="Pagination" class="pagination"><!-- 这里显示分页 --></div>	
	</div>
	<input type="reset" value="返回" class="btn btn_return"/>
</div>

</body>
</html>